﻿@using FwProject.Car.Dto
@using FwProject.Core.Car
@model CarInfoInputDto
@{
    Layout = null;
}
<div class="modal-dialog">
    <div class="modal-content animated fadeIn">
        <form class="form-horizontal" action="/Car/CreateCar" method="post" novalidate="novalidate" data-ajax="true" data-ajax-success="ReloadAjaxCallbackgoback" data-ajax-failure="FailureAjaxCallback" data-ajax-method="Post" role="form">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">添加汽车</h4>
            </div>
            <div class="modal-body">
                <div class="form-body">
                    @Html.AntiForgeryToken()

                    <div class="form-group">
                        @Html.LabelFor(o => o.EmployeeCarUserId, new { @class = "control-label col-md-3" })
                        <div class="col-md-6">
                            @Html.DropDownListFor(o => o.EmployeeCarUserId, ViewBag.Driver as IEnumerable<SelectListItem>, new { @class = "form-control" })
                            @Html.ValidationMessageFor(o => o.EmployeeCarUserId)
                        </div>
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(o => o.PlatesNumber, new { @class = "control-label col-md-3" })
                        <div class="col-md-6">
                            @Html.TextBoxFor(o => o.PlatesNumber, new { @class = "form-control" , placeholder = "车牌号" })
                            @Html.ValidationMessageFor(o => o.PlatesNumber)
                        </div>
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(o => o.CarType, new { @class = "control-label col-md-3" })
                        <div class="col-md-6">
                            <enums asp-enum="@(Model!=null?Model.CarType.GetType():(new CarInfoInputDto()).CarType.GetType())" asp-valuetype="1" asp-name="CarType" class="form-control"></enums>
                            @Html.ValidationMessageFor(o => o.CarType)
                        </div>
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(o => o.ShoppingTon, new { @class = "control-label col-md-3" })
                        <div class="col-md-6">
                            @Html.TextBoxFor(o => o.ShoppingTon, new { @class = "form-control" , placeholder = "吨位" })
                            @Html.ValidationMessageFor(o => o.ShoppingTon)
                        </div>
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(o => o.Insurance, new { @class = "control-label col-md-3" })
                        <div class="col-md-6">
                            <BoolSelect asp-value="@(Model!=null?Model.Insurance:(new CarInfoInputDto()).Insurance)" asp-name="Insurance" class="form-control"></BoolSelect>
                            @Html.ValidationMessageFor(o => o.Insurance)
                        </div>
                    </div>
                    <div class="form-group" style="z-index:9999">
                        @Html.LabelFor(o => o.CarOld, new { @class = "control-label col-md-3" })
                        <div class="input-group date col-md-6" style="z-index:9999">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            @Html.TextBoxFor(o => o.CarOld, new { @class = "form-control", style = "z-index:9999", Value = DateTime.Now.ToString("yyyy-MM-dd") , placeholder = "购买时间" })
                            @Html.ValidationMessageFor(o => o.CarOld)
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="reset" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="submit" class="btn btn-primary" data-loading-text="执行中...">保存</button>
            </div>
        </form>
    </div>
    <!-- /.modal-content -->
</div>
